// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';

export async function getPlanJobPage(
  data: {
    current?: number;
    pageSize?: number;
    [key:string]:any
  },
  options?: { [key: string]: any },
) {
  return request<{
    data:any;
    code?: number;
    success?: boolean;
  }>('/engine-service/api/v1/plan_job/page', {
    method: 'POST',
    data,
    ...(options || {}),
  });
}

export async function updateJob(data: { [key: string]: any }, options?: { [key: string]: any }) {
  return request<{
    data:any;
    code?: number;
    success?: boolean;
  }>('/engine-service/api/v1/plan_job/update', {
    data,
    method: 'PUT',
    ...(options || {}),
  });
}

export async function addJob(data: { [key: string]: any }, options?: { [key: string]: any }) {
  return request<{
    data:any;
    code?: number;
    success?: boolean;
  }>('/engine-service/api/v1/plan_job/save', {
    data,
    method: 'POST',
    ...(options || {}),
  });
}

export async function batchDel(data: { [key: string]: any  }, options?: { [key: string]: any }) {
  return request<Record<string, any>>('/engine-service/api/v1/plan_job/batch_del', {
    data,
    method: 'DELETE',
    ...(options || {}),
  });
}
